package com.yami.shop.consign.api.controller;

import com.yami.shop.bean.vo.ConsignRecordVO;
import com.yami.shop.common.bean.PageDTO;
import com.yami.shop.common.bean.PageVO;
import com.yami.shop.common.response.ServerResponseEntity;
import com.yami.shop.consign.common.service.ConsignRecordService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

@RestController
@RequestMapping("/app/consign/record")
@Tag(name = "寄售商品详情记录（c端）")
@AllArgsConstructor
@Slf4j
public class ConsignRecordController {

    private final ConsignRecordService consignRecordService;

    @GetMapping("/ua/page")
    @Operation(summary =  "单个寄售商品追踪记录", description = "单个寄售商品追踪记录")
    public ServerResponseEntity<PageVO<ConsignRecordVO>> getRecordList(@Valid PageDTO pageDTO, @Param("nftId") String nftId) {
        PageVO<ConsignRecordVO> recordList = consignRecordService.getRecordList(pageDTO, nftId);
        return ServerResponseEntity.success(recordList);
    }
}
